<template>
  <div class="zuixinzhuanti" ref="zxzt">
    <div class="zuixinzhuantidiv">
      <div class="zuixinzhuantidivyi">最新专题</div>
      <div class="zuixinzhuantidiver">查看全部></div>
    </div>

    <div class="zuixiantidivxia">
      <ul>
        <li v-for="item in zuixinlist" :key="item.id">
          <img src="" alt="" v-lazy="item.detailsUrl" />
          <div class="zuixindivxiayi">
            <p>{{ item.title }}</p>
            <p>{{ item.summary }}</p>
            <p>￥{{ item.lowestPrice }}起</p>
          </div>
          <div class="zuixindivxiaer">
            <div>
              <span><i class="iconfont icon-hart1"></i> {{ item.viewNum }}</span
              >&emsp;&emsp;
              <span> <i class="iconfont icon-see"></i>{{ item.replyNum }}</span>
            </div>
            <div>
              <span>
                <i class="iconfont icon-message"></i>{{ item.collectNum }}</span
              >
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import { lazyload } from "@/utils/constfun";
import { getzuixinapi } from "@/utils/api/headerapi";
export default {
  data() {
    return {
      zuixinlist: [],
    };
  },
  methods: {
    async getzuixinlist() {
      let res = await getzuixinapi();
      // console.log(res);
      this.zuixinlist = res.result;
    },
  },
  mounted() {
    // this.getzuixinlist()
    lazyload(this.$refs.zxzt, this.getzuixinlist);
  },
};
</script>
<style lang="scss">
@import "@/assets/css/mixin.scss";
.zuixinzhuanti {
  background: #fff;
  .zuixinzhuantidiv {
    width: 100%;
    height: 115px;
    display: flex;
    justify-content: space-between;

    .zuixinzhuantidivyi {
      font-size: 25px;
      line-height: 115px;
    }

    .zuixinzhuantidiver {
      font-size: 15px;
      color: gray;
      line-height: 115px;
    }
  }

  .zuixiantidivxia {
    ul {
      list-style: none;
      display: flex;
      justify-content: space-between;

      li {
        width: 404px;
        height: 380px;
        position: relative;

        img {
          width: 404px;
          height: 288px;
        }

        .zuixindivxiayi {
          width: 100%;
          height: 100px;
          // background-color: red;
          position: absolute;
          top: 220px;
          left: 0;
          color: #fff;
          // position: relative;
          p:nth-child(1) {
            font-size: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 270px;
            padding-left: 20px;
          }

          p:nth-child(2) {
            color: gray;
            padding-left: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 270px;
          }
          p:nth-child(3) {
            position: absolute;
            top: 20px;
            left: 300px;
            width: 80px;
            height: 25px;
            line-height: 25px;
            text-align: center;
            color: red;
            display: flex;
            top: 20px;
            background-color: #fff;
          }
        }
        .zuixindivxiaer {
          margin-top: 30px;
          display: flex;
          justify-content: space-between;
        }
      }
      li:hover {
        @include hoverShadow;
      }
    }
  }
}
</style>